
import random

orgin=[	0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x010E, 
		0x0202, 0x0203, 0x0204, 0x0205, 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x020B, 0x020C, 0x020D, 0x020E,
		0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308, 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x030E,
		0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x040D, 0x040E
]

class poker:
	def __init__(self):
		self.num = 52
		self.pokers = orgin
		self.index = 0

	def shuffle(self, key):
		for i in range(0, 52):
			pos = random.randrange(0, 52)
			tmp = self.pokers[i]
			self.pokers[i] = self.pokers[pos]
			self.pokers[pos] = tmp


	def popPoker(self):
		if self.index < 0 or self.index >= 52:
			return -1
		poker = self.pokers[self.index]
		self.index = self.index + 1
		return poker

	def printAll(self):
		for i in range(0, 52):
			print "%x" % self.pokers[i], 
			if i % 10 == 0:
				print 